var jsonengine = function(dt){
	this.docType = dt;

	this.checkBefore = function(){
		
	}

	this.ajax = function(){
		//第一引数は必ず文字列
	}

	this.checkBefore = function(){
		
	}

	this.post = function(){
		console.log(arguments)
		this.checkBefore(arguments);
	}
	this.get = function(){
	}
	this.put = function(){
	}
	this.del = function(){
	}

	this.create = function(){
		console.log(arguments)
		var a = [this.docType];
		for(var i=0;i<arguments.length;i++)a[i+1]=arguments[i];
		console.log(a)
		this.post(a);
	}
	this.read = function(){
	}
	this.update = function(){
	}
	this.destroy = function(){
	}
};

$(function(){


	var je = new jsonengine('myDoc');
	console.log(je.docType)

	je.docType='tasks';

	je.create({"foo":"bar"}, function(response, status){
		// do something with task here
	});

	je.read({"foo":".eq.bar"}, function(response, status){
		// do something with task here
	});

	je.update({"foo":"bar","_docId":"00roxf3RwEBi1ZobhYECZdUnT766oU97"}, function(response, status){
		// do something with task here
	});

	je.destroy({"_docId":"00roxf3RwEBi1ZobhYECZdUnT766oU97"}, function(response, status){
		// do something with task here
	});

});
